#include "server.hpp"

void Usage(const std::string& proc)
{
    std::cout << "\n\t" << proc << " serverPort" << std::endl;
}

std::string service(const std::string& str)
{
    std::string result;
    for(auto e : str)
    {
        char c = e;
        if(islower(e))
        {
            c = toupper(e);
        }
        result.push_back(c);
    }
    return result;
}

int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USERERR);
    }
    uint16_t port = atoi(argv[1]);
    ns_server* server = new ns_server(service,port);


    server->init();
    server->Start();
    delete server;

    return 0;
}



